package com.ruoyi.slope.human.rockfall.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.slope.human.rockfall.mapper.SlopeHumanRockfallMapper;
import com.ruoyi.slope.human.rockfall.domain.SlopeHumanRockfall;
import com.ruoyi.slope.human.rockfall.service.ISlopeHumanRockfallService;

/**
 * 边坡落石Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-27
 */
@Service
public class SlopeHumanRockfallServiceImpl implements ISlopeHumanRockfallService 
{
    @Autowired
    private SlopeHumanRockfallMapper slopeHumanRockfallMapper;

    /**
     * 查询边坡落石
     * 
     * @param id 边坡落石主键
     * @return 边坡落石
     */
    @Override
    public SlopeHumanRockfall selectSlopeHumanRockfallById(Long id)
    {
        return slopeHumanRockfallMapper.selectSlopeHumanRockfallById(id);
    }

    /**
     * 查询边坡落石列表
     * 
     * @param slopeHumanRockfall 边坡落石
     * @return 边坡落石
     */
    @DataScope(deptAlias = "s")
    @Override
    public List<SlopeHumanRockfall> selectSlopeHumanRockfallList(SlopeHumanRockfall slopeHumanRockfall)
    {
        return slopeHumanRockfallMapper.selectSlopeHumanRockfallList(slopeHumanRockfall);
    }

    /**
     * 新增边坡落石
     * 
     * @param slopeHumanRockfall 边坡落石
     * @return 结果
     */
    @Override
    public int insertSlopeHumanRockfall(SlopeHumanRockfall slopeHumanRockfall)
    {
        slopeHumanRockfall.setCreateTime(DateUtils.getNowDate());
        return slopeHumanRockfallMapper.insertSlopeHumanRockfall(slopeHumanRockfall);
    }

    /**
     * 修改边坡落石
     * 
     * @param slopeHumanRockfall 边坡落石
     * @return 结果
     */
    @Override
    public int updateSlopeHumanRockfall(SlopeHumanRockfall slopeHumanRockfall)
    {
        slopeHumanRockfall.setUpdateTime(DateUtils.getNowDate());
        return slopeHumanRockfallMapper.updateSlopeHumanRockfall(slopeHumanRockfall);
    }

    /**
     * 批量删除边坡落石
     * 
     * @param ids 需要删除的边坡落石主键
     * @return 结果
     */
    @Override
    public int deleteSlopeHumanRockfallByIds(Long[] ids)
    {
        return slopeHumanRockfallMapper.deleteSlopeHumanRockfallByIds(ids);
    }

    /**
     * 删除边坡落石信息
     * 
     * @param id 边坡落石主键
     * @return 结果
     */
    @Override
    public int deleteSlopeHumanRockfallById(Long id)
    {
        return slopeHumanRockfallMapper.deleteSlopeHumanRockfallById(id);
    }
}
